<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改心愿单')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-signWish-edit" th:object="${signWish}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			
			<h4 class="form-header h4">用户信息</h4>
			<div class="form-group">	
				<label class="col-sm-2 control-label">用户昵称：</label>
				<div class="col-sm-3">
					<input th:value="${user.nickname}" class="form-control" type="text">
				</div>
		
				<!-- <label class="col-sm-2 control-label">真实姓名：</label>
				<div class="col-sm-3">
					<input th:value="${user.realname}" class="form-control" type="text">
				</div> -->
			</div>
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">联系方式：</label>
				<div class="col-sm-3">
					<input th:value="${user.mobile}" class="form-control" type="text">
				</div>
			
				<label class="col-sm-2 control-label">学校：</label>
				<div class="col-sm-3">
					<input th:value="${user.school}" class="form-control" type="text">
				</div>
			</div>
			
			
			<h4 class="form-header h4">心愿单信息</h4>
			<div class="form-group">	
				<label class="col-sm-2 control-label">图片：</label>
				<div class="col-sm-8">
					<input id="tps" name="tps" th:field="*{tps}" class="form-control" type="hidden">
					<img id="tpsSrc" width="200px" height="200px" onclick="avator()"/>
				</div>
			</div>
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">心愿单类型：</label>
				<div class="col-sm-3">
				<select id="type" name="type" class="form-control m-b" th:field="*{type}">
							<option value=8003>小心愿单</option>
							<option value=8004>大心愿单</option>							
					</select>
				</div>
				
				
				<label class="col-sm-2 control-label">状态：</label>
				<div class="col-sm-3">
				<select id="state" name="state" class="form-control m-b" th:field="*{state}">
					    <option value="8100">未使用</option>
						<option value="8101">待处理</option>
						<option value="8102">审核成功</option>
						<option value="8103">审核失败</option>
						<option value="8104">助力失败</option>
						<option value="8105">未兑现心愿单</option>
						<option value="8106">已兑现心愿单</option>					
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">心愿预算：</label>
				<div class="col-sm-3">
					<input id="yusuan" name="yusuan" th:field="*{yusuan}" class="form-control" type="text">
				</div>
			</div>
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">收货人姓名：</label>
				<div class="col-sm-8">
					<input th:value="${address.realname}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">收货人电话：</label>
				<div class="col-sm-8">
					<input th:value="${address.mobile}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">收货人详细地址：</label>
				<div class="col-sm-8">
					<input th:value="${address.address}" class="form-control" type="text">
				</div>
			</div>
			
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">内容：</label>
				<div class="col-sm-8">
					<textarea id="content" name="content" th:field="*{content}" class="form-control"></textarea>
				</div>
			</div>
			
			
			
			<h4 class="form-header h4">助力情况</h4>
			<div class="form-group">	
				<label class="col-sm-2 control-label">助力进度：</label>
				<div class="col-sm-3">
				<select id="sffb" name="sffb" class="form-control m-b" th:field="*{sffb}">
							<option value="1">已开始助力</option>
						<option value="0">未开始助力</option>						
					</select>
				</div>
			
				<label class="col-sm-2 control-label">总共所需助力数：</label>
				<div class="col-sm-3">
					<input id="helpNum" name="helpNum" th:field="*{helpNum}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">当前助力数：</label>
				<div class="col-sm-3">
					<input id="helpWanc" name="helpWanc" th:field="*{helpWanc}" class="form-control" type="text">
				</div>
				
				<label class="col-sm-2 control-label">结束日期：</label>
				<div class="col-sm-3">
					<input id="helpJsDate" name="helpJsDate" th:field="*{helpJsDate}" class="form-control" type="text">
				</div>
			</div>
			
			
			<h4 class="form-header h4">修改信息</h4>
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">创建时间：</label>
				<div class="col-sm-3">
					<input id="createDate" name="createDate" th:field="*{createDate}" class="form-control" type="text" readonly="readonly">
				</div>
			
				<label class="col-sm-2 control-label">修改时间：</label>
				<div class="col-sm-3">
					<input id="modifyDate" name="modifyDate" th:field="*{modifyDate}" class="form-control" type="text" readonly="readonly">
				</div>
			</div>
			
			
			
		</form>
    </div>
    <div th:include="include::footer"></div>
    <th:block th:include="include :: select2-js" />
    <script type="text/javascript">
		var prefix = ctx + "SignWish/signWish";
		$("#form-signWish-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-signWish-edit').serialize());
	        }
	    }
		
	
		
		var img = document.getElementById('tpsSrc');
		var fileinput = document.getElementById('tps');
		if (fileinput.value != '') {
			img.src = fileinput.value;
		}
	</script>
</body>
</html>
